Skip to content

Structured BuilderProblem pipeline for DiagnosticCollector - #12702

Draft
gnodet wants to merge 2 commits into
feature/warning-modefrom
feature/12643-structured-problems
Draft

Structured BuilderProblem pipeline for DiagnosticCollector#12702
gnodet wants to merge 2 commits into
feature/warning-modefrom
feature/12643-structured-problems

Conversation

@gnodet

@gnodet gnodet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the build report / warning mode chain. This PR implements the structured BuilderProblem pipeline for the 4 pathways identified in the foundation work, plus a full migration of the PluginValidationManager interface.

Commit 1: Pipe structured BuilderProblems into DiagnosticCollector (Pathways 1–4)

Pathway 2 — Plugin parameter validation (AbstractMavenPluginParametersValidator): 3 validators now create BuilderProblem with structured key, severity, and suggestion, and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 3 — Plugin dependency validation (AbstractMavenPluginDependenciesValidator): 4 validators now create BuilderProblem with structured key and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 4 — Plugin manager Contextualizable check (DefaultMavenPluginManager): creates BuilderProblem with key plugin-validation:contextualizable and pipes through PluginValidationManagerDiagnosticCollector.

Commit 2: Migrate PluginValidationManager to native BuilderProblem API

  • Changed PluginValidationManager interface: 3 abstract methods now accept BuilderProblem instead of String
  • Added @Deprecated(since = "4.1.0", forRemoval = true) String-based default methods as backward-compat adapters
  • Updated all 9 call sites across 8 files to create BuilderProblem natively

PR chain

Test plan

  • mvn test -pl impl/maven-core — tests pass
  • CI

🤖 Generated with Claude Code

gnodet and others added 2 commits August 8, 2026 21:35
…ollector

Route structured validation problems from 4 pathways (settings, toolchains,
model validation, graph building) into DefaultDiagnosticCollector so they
appear in the build report with full key/suggestion/documentationUrl metadata
instead of being re-logged as plain text.

Pathways:
- LookupInvoker: settings validation problems
- MavenInvoker: toolchains validation problems
- DefaultProjectsSelector: model validation problems (ModelProblem → BuilderProblem)
- DefaultMaven: graph building problems (ModelProblem → BuilderProblem)

Also adds EXCLUDED_LOGGERS in BuildReportCollector to prevent double-counting
when the same problems are both piped structurally and logged via SLF4J.

Migrates all test files from DefaultBuilderProblem constructor to
BuilderProblem.builder() API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change the PluginValidationManager interface from String-based to
BuilderProblem-based, enabling structured problem reporting with keys,
severity, and suggestions throughout the plugin validation pipeline.

- Change 3 abstract report methods from String issue to BuilderProblem
- Add deprecated String-based default methods for backward compat
- Update all 9 call sites (7 validators + 1 plugin manager) to create
  BuilderProblem with structured key, severity, and suggestion
- Inject DefaultDiagnosticCollector into DefaultPluginValidationManager
  to pipe problems into the diagnostic pipeline
- Add japicmp exclusion for the intentional API break
- Add DefaultPluginValidationManager to EXCLUDED_LOGGERS in
  BuildReportCollector to prevent double-counting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the feature/warning-mode branch from 7243fd7 to af945c2 Compare August 8, 2026 19:35
@gnodet
gnodet force-pushed the feature/12643-structured-problems branch from c5cdbba to b0d3de4 Compare August 8, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant